package Exam.AttackGame;

public class TastGame {
    public static void main(String[] args) {
        //创建两个角色
        Role r1 = new Role("K酱",100);
        Role r2 = new Role("莎莎",100);

        //开始回合制攻击
        while (true){
            //r1开始攻击r2
            r1.attack(r2);
            //判断r2的剩余血量（是否战败）
            if(r2.getBlood() == 0){
                System.out.println(r1.getName()+"打败了"+r2.getName());
                break;
            }

            //r2开始攻击r1
            r2.attack(r1);
            //判断r2的剩余血量（是否战败）
            if(r1.getBlood() == 0){
                System.out.println(r2.getName()+"打败了"+r1.getName());
                break;
            }

        }

    }
}
